#!/usr/bin/env bash


port=$1
service='finger'
iip="sh ../api/subscribe.sh $port $service"
isize="sh ../api/size.sh $port $service"

size=`eval $isize`



git config --global push.default simple
git config --global user.email 496952252@qq.com
git config --global user.name "Alexander"
git config --global credential.helper store


while true
do
    if [[ $size -gt  0 ]]
    then
        echo "size: $size"
        file=`eval $iip`
        cmd="python Finger.py -f ../dic/mas/$file -p $port -t 20"
        eval $cmd
        sleep 3
        git pull
        sleep 3
        git commit -a -m 123
        git push
        size=`eval $isize`
    else
        echo "listening..."
        sleep 10
        size=`eval $isize`
    fi
done






